home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / TDOOR201.ZIP;1 / TRIDOOR.DOC < prev    next >
Encoding:
Text File  |  1994-02-04  |  28.8 KB  |  1,387 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.                                      TriDoor
  33.                                    Version 2.0
  34.                        Copyright (c) 1992-1994 By TriSoft
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.      TriDoor                                                              i
  74.  
  75.                                 COPYRIGHT NOTICE
  76.                                 ----------------
  77.  
  78.      TriDoor is a copyrighted program being distributed under the shareware
  79.      concept.  As such you may use TriDoor for  a period of 30 days without
  80.      registering the software.   After  the 30 day  evaluation period,  you
  81.      must register  your copy of  TriDoor or  you will be  in violation  of
  82.      United States and International copyright laws.
  83.  
  84.      As  a shareware program, TriDoor  may be freely  distributed through a
  85.      BBS.   Shareware distributors may distribute copies of TriDoor on disk
  86.      for a modest disk duplication charge not to exceed $6 per disk.
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.      TriDoor                                                             ii
  140.  
  141.                                     WARRANTY
  142.                                     --------
  143.  
  144.      TriDoor is distributed without warranty.  In no event will  TriSoft be
  145.      liable  to  you  for damages,  including  any  loss  of profits,  lost
  146.      savings, or other  incidental or consequential damages  arising out of
  147.      your use of  or inability to use  the program, even  if TriSoft or  an
  148.      authorized representative has been advised of the possibility of  such
  149.      damages.  TriSoft will not  be liable for any such claim by  any other
  150.      party.
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.      TriDoor                                                            iii
  206.  
  207.                                 TABLE OF CONTENTS
  208.                                 -----------------
  209.  
  210.  
  211.      INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
  212.  
  213.      USING TRIDOOR . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  214.  
  215.      RUNNING A TRIDOOR DOOR  . . . . . . . . . . . . . . . . . . . . . .  3
  216.  
  217.      SPECIAL KEYS  . . . . . . . . . . . . . . . . . . . . . . . . . . .  4
  218.  
  219.      THE TRIDOOR VARIABLES . . . . . . . . . . . . . . . . . . . . . . .  5
  220.           TDAlias  . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  221.           TDAnsiColor  . . . . . . . . . . . . . . . . . . . . . . . . .  5
  222.           TDBaudRate . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  223.           TDBBSName  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  224.           TDCityState  . . . . . . . . . . . . . . . . . . . . . . . . .  5
  225.           TDDoorName . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  226.           TDDropToDOS  . . . . . . . . . . . . . . . . . . . . . . . . .  5
  227.           TDErrorCorrecting  . . . . . . . . . . . . . . . . . . . . . .  6
  228.           TDNode . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  229.           TDLockedBaudRate . . . . . . . . . . . . . . . . . . . . . . .  6
  230.           TDMinutesLeft  . . . . . . . . . . . . . . . . . . . . . . . .  6
  231.           TDNonStandardIRQ . . . . . . . . . . . . . . . . . . . . . . .  6
  232.           TDPhoneNumber  . . . . . . . . . . . . . . . . . . . . . . . .  6
  233.           TDSecurityLevel  . . . . . . . . . . . . . . . . . . . . . . .  6
  234.           TDSerialPort . . . . . . . . . . . . . . . . . . . . . . . . .  6
  235.           TDSysopName  . . . . . . . . . . . . . . . . . . . . . . . . .  7
  236.           TDUserFirstName  . . . . . . . . . . . . . . . . . . . . . . .  7
  237.           TDUserName . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  238.  
  239.      THE TRIDOOR FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . .  8
  240.           TDBeepRemote . . . . . . . . . . . . . . . . . . . . . . . . .  8
  241.           TDClrScr . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  242.           TDDetectANSI . . . . . . . . . . . . . . . . . . . . . . . . .  8
  243.           TDDetectRIPScrip . . . . . . . . . . . . . . . . . . . . . . .  8
  244.           TDDisplayFile  . . . . . . . . . . . . . . . . . . . . . . . .  8
  245.           TDDisplayBreakableFile . . . . . . . . . . . . . . . . . . . .  8
  246.           TDGetBackground  . . . . . . . . . . . . . . . . . . . . . . .  8
  247.           TDGetch  . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  248.           TDGetForeground  . . . . . . . . . . . . . . . . . . . . . . .  9
  249.           TDGets . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  250.           TDGotoXY . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  251.           TDInitialize . . . . . . . . . . . . . . . . . . . . . . . . .  9
  252.           TDKeyPressed . . . . . . . . . . . . . . . . . . . . . . . . .  9
  253.           TDHangUp . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  254.           TDPrintf . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  255.           TDPutch  . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  256.           TDPuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  257.           TDSetColor . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  258.           TDTimeLeft . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.      TriDoor                                                             iv
  272.  
  273.           TDTimeOn . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  274.  
  275.      ADVANCED SERIAL COMMUNICATIONS ROUTINES . . . . . . . . . . . . . . 12
  276.           TDCommClose  . . . . . . . . . . . . . . . . . . . . . . . . . 12
  277.           TDCommKeyPressed . . . . . . . . . . . . . . . . . . . . . . . 12
  278.           TDCommModemString  . . . . . . . . . . . . . . . . . . . . . . 12
  279.           TDCommOpen . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  280.           TDCommPutch  . . . . . . . . . . . . . . . . . . . . . . . . . 13
  281.           TDCommPuts . . . . . . . . . . . . . . . . . . . . . . . . . . 13
  282.           TDCommSetBaudRate  . . . . . . . . . . . . . . . . . . . . . . 13
  283.           TDCommSetDataFormat  . . . . . . . . . . . . . . . . . . . . . 13
  284.           TDCommSetDTR . . . . . . . . . . . . . . . . . . . . . . . . . 13
  285.           TDCommSetFIFO  . . . . . . . . . . . . . . . . . . . . . . . . 13
  286.           TDCommSetPort  . . . . . . . . . . . . . . . . . . . . . . . . 14
  287.  
  288.      SUPPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
  289.  
  290.      REGISTRATION  . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      TriDoor                                                              1
  338.  
  339.                                   INTRODUCTION
  340.                                   ------------
  341.  
  342.      TriDoor  is  a comprehensive  set  of  Borland  C++, Microsoft  C/C++,
  343.      Symantec C++, Turbo C++,  and Watcom C/C++ (the 16-bit  version of the
  344.      compiler  only) functions  designed  to enable  programmers to  easily
  345.      write  doors for  BBSes.   The following  are some  of TriDoor's  many
  346.      features:
  347.  
  348.           Assembly  language serial input/output  routines for maximum
  349.           speed.
  350.  
  351.           Fully supports  high speed modems: 16550  FIFO buffering and
  352.           locked serial ports.
  353.  
  354.           Built in ANSI terminal  emulator.  No need to  have ANSI.SYS
  355.           loaded in memory.
  356.  
  357.           Optional detection of RIPScrip graphics.
  358.  
  359.           TriDoor is DesqView aware.
  360.  
  361.           Supports all  of the  most popular  door data file  formats:
  362.           TriBBS, PCBoard,  GAP (DOOR.SYS), Spitfire,  WildCat!, RBBS,
  363.           and WWIV.  Thus,  a door built around TriDoor  is compatible
  364.           with a wide range of BBS software.
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.      TriDoor                                                              2
  404.  
  405.                                   USING TRIDOOR
  406.                                   -------------
  407.  
  408.      TriDoor is  supplied  with the  following  shareware versions  of  the
  409.      TriDoor library.
  410.  
  411.      ======================================================================
  412.      Compiler            Library
  413.      ----------------------------------------------------------------------
  414.      Borland C++         BCTDOOR.LIB
  415.      Microsoft C/C++     MCTDOOR.LIB
  416.      Symantec C++        SCTDOOR.LIB
  417.      Turbo C++           TCTDOOR.LIB
  418.      Watcom C/C++        WCTDOOR.LIB
  419.      ======================================================================
  420.  
  421.      Because  TriDoor  comes supplied  as a  library  it can  be seamlessly
  422.      integrated with your door program by  simply including the name of the
  423.      library either in  the door program's project  file or in the  command
  424.      line that  you use to  compile the program.   Additionally, you should
  425.      include  TriDoor's header file (TRIDOOR.H) in  all your door program's
  426.      source  code  files.   Please  note  that  the  TriDoor libraries  are
  427.      compiled  using the large memory  model; therefore, your door programs
  428.      much be compiled using the large memory model too.
  429.  
  430.      To initialize the TriDoor  door driver routines, you must  always call
  431.      TriDoor's TDInitialize function  at the  start of your  program.   The
  432.      TDInitialize function  must be  called before  your program  makes any
  433.      calls to any of TriDoor's other functions.
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.      TriDoor                                                              3
  470.  
  471.                              RUNNING A TRIDOOR DOOR
  472.                              ----------------------
  473.  
  474.      A TriDoor-based  door program is run by  entering a command similar to
  475.      the following:
  476.       
  477.      door config nonstandardirq
  478.  
  479.      In the  above command line, "door" is the name of your door's EXE file
  480.      and the "config"  parameter is  the name of  the door's  configuration
  481.      file.  The configuration file can have any name the sysop chooses, but
  482.      it must reside  in the same directory as the  door.  The configuration
  483.      file is an ASCII text file with the following format:
  484.  
  485.      Line 1:   Door data file type.
  486.      Line 2:   Path to the door data file(s).
  487.      Line 3:   BBS name.
  488.      Line 4:   Sysop's name.
  489.      Line 5:   Locked baud rate.
  490.  
  491.      As illustrated above, the door's data file type is specified in line 1
  492.      and can be PCB for  PCBoard, GAP for GAP (DOOR.SYS), SF  for Spitfire,
  493.      RBBS  for RBBS, WC for WildCat!, TRIBBS  for TriBBS, or WWIV for WWIV.
  494.      The  locked baud rate  is specified in  line 5.   If the sysop doesn't
  495.      lock his  serial port, he  must specify  0 for the  locked baud  rate.
  496.      NOTE:  Although many door formats do pass  the locked baud rate in the
  497.      door  data  files, some  older  formats  such as  RBBS  do  not.   For
  498.      conformity,  TriDoor requires that you specify the locked baud rate in
  499.      line 5 and ignores any value passed in the door data files.
  500.  
  501.      The following is a sample door configuration file:
  502.  
  503.      TRIBBS
  504.      C:\TRIBBS\
  505.      The Lobster Buoy
  506.      Mark Goodwin
  507.      38400
  508.  
  509.      The "nonstandardirq"  parameter is used  to specify a  nonstandard IRQ
  510.      for the serial port.  The legitimate range of values is from 0 to 15.
  511.  
  512.      TriDoor can  be run locally  without a door  data file (handy  for the
  513.      sysop  to use the  door without logging  on to the  BBS) by specifying
  514.      LOCAL  after the configuration file parameter in the DOS command line.
  515.      TriDoor will request  the user  to enter his  name before running  the
  516.      door.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.      TriDoor                                                              4
  536.  
  537.                                   SPECIAL KEYS
  538.                                   ------------
  539.  
  540.      While a door is running,  the sysop can press certain special  keys to
  541.      perform a  variety of  functions.   The  following is  a  list of  the
  542.      functions that the TriDoor special keys perform:
  543.  
  544.      Key(s)              Function
  545.  
  546.      HOME                Toggles between the user  status window and a help
  547.                          display that lists the TriDoor special keys.
  548.  
  549.      F6                  Takes 5 minutes away from the caller.
  550.                          NOTE:  This will NOT be returned to BBS.
  551.  
  552.      F7                  Gives 5 minutes to the caller.
  553.                          NOTE:  This will NOT be returned to the BBS.
  554.  
  555.      F9                  Quit the door and return the caller to the BBS.
  556.  
  557.      F10                 Enter  chat mode.  Pressing the  ESC key exits the
  558.                          chat mode.
  559.  
  560.      Alt+D               Drop to DOS.
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.      TriDoor                                                              5
  602.  
  603.                               THE TRIDOOR VARIABLES
  604.                               ---------------------
  605.  
  606.      The following are the  global variables that TriDoor supplies  for the
  607.      door author's convenience:
  608.  
  609.  
  610.      char TDAlias[81];
  611.  
  612.      The  TDAlias variable holds the  caller's alias.   Note: This variable
  613.      will be set to the user's name for PCB, RBBS, WC, and SF.
  614.  
  615.  
  616.      int TDAnsiColor;
  617.  
  618.      The  TDAnsiColor variable is  set to 1  for a caller  using ANSI color
  619.      graphics or to 0 for a monochrome caller.
  620.  
  621.  
  622.      long TDBaudRate;
  623.  
  624.      The  TDBaudRate variable  holds the caller's  baud rate.   This is the
  625.      caller's  actual connection rate and not the  locked baud rate.  NOTE:
  626.      TriDoor will set TDBaudRate to 0 for local calls.
  627.  
  628.  
  629.      char TDBBSName[81];
  630.  
  631.      The TDBBSName variable holds the BBS's name.
  632.  
  633.  
  634.      char TDCityState[81];
  635.  
  636.      The TDCityState variable holds  the user's city and  state.  This  may
  637.      not be supported  by all door formats and will be set to a null string
  638.      if not.
  639.  
  640.  
  641.      char TDDoorName[81];
  642.  
  643.      The TDDoorName variable holds  the door's name.  The door's  name will
  644.      be displayed in the user status window.  NOTE: It is the door author's
  645.      responsibility to assign a value to this variable.
  646.  
  647.  
  648.      void (*TDDropToDOS)(void);
  649.  
  650.      This is a pointer to a user-defined drop to DOS function.  This is not
  651.      required in order for  TriDoor to drop to DOS;  however, this function
  652.      is  a  hook so  that  the  door program  can  implement such  advanced
  653.      features as swapping the door out of memory, etc.
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.      TriDoor                                                              6
  668.  
  669.      int TDErrorCorrecting;
  670.  
  671.      The TDErrorCorrecting variable  will be set to 1 if  there is an error
  672.      correcting connection.   Otherwise, this variable will  be set to 0 to
  673.      indicate  a nonerror correcting connection.   Note: This variable will
  674.      be always be set to 0 for RBBS and WWIV.
  675.  
  676.  
  677.      int TDNode;
  678.  
  679.      The  TDNode variable  holds  the caller's  node  number.   Note:  This
  680.      variable will always be set to 1 for RBBS and WWIV.
  681.  
  682.  
  683.      long TDLockedBaudRate;
  684.  
  685.      The  TDLockedBaudRate variable  holds  the serial  port's locked  baud
  686.      rate, if any.
  687.  
  688.  
  689.      int TDMinutesLeft;
  690.  
  691.      The  TDMinutesLeft variable holds the number of minutes the caller had
  692.      remaining when he entered the door.
  693.  
  694.  
  695.      int TDNonStandardIRQ;
  696.  
  697.      The TDNonStandardIRQ variable holds  the number for a  nonstandard IRQ
  698.      if   one  was  passed  on   the  door's  command   line.    Otherwise,
  699.      TDNonStandardIRQ will be equal to 0.
  700.  
  701.  
  702.      char TDPhoneNumber[81];
  703.  
  704.      The  TDPhoneNumber variable holds the  user's phone number.   This may
  705.      not be supported by all door formats and will be set  to a null string
  706.      if not.
  707.  
  708.  
  709.      int TDSecurityLevel;
  710.  
  711.      The TDSecurityLevel variable holds the caller's security level.
  712.  
  713.  
  714.      int TDSerialPort;
  715.  
  716.      The TDSerialPort variable holds the number of the serial port.
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.      TriDoor                                                              7
  734.  
  735.      char TDSysopName[81];
  736.  
  737.      The TDSysopName variable holds the sysop's name.
  738.  
  739.  
  740.      char TDUserFirstName[81];
  741.  
  742.      The TDUserFirstName variable holds the user's first name.
  743.  
  744.  
  745.      char TDUserName[81];
  746.  
  747.      The TDUserName variable holds the user's name.
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.      TriDoor                                                              8
  800.  
  801.                               THE TRIDOOR FUNCTIONS
  802.                               ---------------------
  803.  
  804.      The following is a explanation of the functions that TriDoor provides:
  805.  
  806.  
  807.      void TDBeepRemote(void);
  808.  
  809.      The TDBeepRemote will send a BELL (0x7) to the remote terminal only.
  810.  
  811.  
  812.      void TDClrScr(void);
  813.  
  814.      The TDClrScr function clears both the local and remote displays.
  815.  
  816.  
  817.      int TDDetectANSI(void);
  818.  
  819.      The  TDDetectANSI function will try  to detect if  the remote caller's
  820.      terminal supports  ANSI terminal emulation.   TDDetectANSI will return
  821.      TRUE  if it successfully detects ANSI  terminal emulation.  Otherwise,
  822.      the TDDetectANSI function will return FALSE.
  823.  
  824.  
  825.      int TDDetectRIPScrip(void);
  826.  
  827.      The  TDDetectRIPScrip function  will  try  to  detect  if  the  remote
  828.      caller's       terminal   supports    RIPScrip   graphics   emulation.
  829.      TDDetectRIPScrip will return TRUE  if it successfully detects RIPScrip
  830.      terminal emulation.   Otherwise,  the  TDDetectRIPScrip function  will
  831.      return FALSE.
  832.  
  833.  
  834.      void TDDisplayFile(char *file);
  835.  
  836.      The TDDisplayFile function displays  the file specified by the  "file"
  837.      parameter 22 lines at a time.
  838.  
  839.  
  840.      void TDDisplayBreakableFile(char *file);
  841.  
  842.      The TDDisplayBreakableFile function displays the file specified by the
  843.      "file" parameter 22 lines at a  time.  If the user presses <SPACE>  at
  844.      any time, TriDoor will skip displaying the remainder of the file.
  845.  
  846.  
  847.      int TDGetBackground(void);
  848.  
  849.      The TDGetBackground function returns the current background color.
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.      TriDoor                                                              9
  866.  
  867.      int TDGetch(void);
  868.  
  869.      The  TDGetch function  waits  for either  a  key to  be  pressed or  a
  870.      character to come  in through the serial port.  As soon as a character
  871.      is  available,  its value  will  be  returned  by  TDGetch.   Extended
  872.      keypresses are returned as 256 + the key's scan code.
  873.  
  874.  
  875.      int TDGetForeground(void);
  876.  
  877.      The TDGetForeground function returns the current foreground color.
  878.  
  879.  
  880.      char *TDGets(char *string, int length);
  881.  
  882.      The TDGets function returns a string that if entered either locally or
  883.      remotely.    The  string's location  is  pointed  to  by the  "string"
  884.      parameter.  The maximum string that TDGets will allow to be determined
  885.      by "length" - 1.
  886.  
  887.  
  888.      void TDGotoXY(int x, int y);
  889.  
  890.      The TDGotoXY procedure  positions the  cursor for both  the local  and
  891.      remote displays.  The cursor's new column position is specified by the
  892.      "x"  parameter  and its  new  row position  is  specified  by the  "y"
  893.      parameter.   NOTE: This will only  work if the user  has ANSI enabled.
  894.      TriDoor will ignore  this statement if called  when the user  does not
  895.      have ANSI enabled.
  896.  
  897.  
  898.      void TDInitialize(int argc, char *argv[]);
  899.  
  900.      The  TDInitialize   function  initializes  the  TriDoor   door  driver
  901.      routines.   This  function must  be called  before you  use any  other
  902.      TriDoor functions in your program.  You must  pass the main function's
  903.      argc and argv parameters to TDInitialize function's parameters.
  904.  
  905.  
  906.      int TDKeyPressed(void);
  907.  
  908.      The  TDKeyPressed function indicates if a key has been pressed locally
  909.      or a character has been  received remotely.  If a character  is ready,
  910.      the TDKeyPressed function will return a value of TRUE.  Otherwise, the
  911.      TDKeyPressed function will return  a value of FALSE to indicate that a
  912.      character isn't available.
  913.  
  914.  
  915.      void TDHangUp(void);
  916.  
  917.      The TDHangUp  function disconnects the  connection by first  trying to
  918.      drop the DTR  line.  If  that is  unsuccessful, the TDHangUp  function
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.      TriDoor                                                             10
  932.  
  933.      will terminate the connection with an ATH0 command.
  934.  
  935.  
  936.      int TDPrintf(char *s, ...);
  937.  
  938.      The  TDPrintf function  acts identically  like the  C runtime  library
  939.      printf function except  it sends the output to both  the local display
  940.      screen and to the remote caller.
  941.  
  942.  
  943.      void TDPutch(int c);
  944.  
  945.      The  TDPutch  function  sends  the  character  specified  by  the  "c"
  946.      parameter to both the local display and to the remote caller.
  947.  
  948.  
  949.      void TDPuts(char *s);
  950.  
  951.      The TDPuts function sends the string specified by the "s" parameter to
  952.      both the local display and to the remote caller.
  953.  
  954.  
  955.      int TDSetColor(int f, int b); 
  956.  
  957.      The TDSetColor procedure sets the foreground color (the "f" parameter)
  958.      and the background  color (the "b"  parameter) for both the  local and
  959.      remote  displays.  NOTE: The colors will only be set if the caller has
  960.      ANSI color graphics enabled.  The foreground colors are as follows:
  961.  
  962.            0 - Black
  963.            1 - Blue
  964.            2 - Green
  965.            3 - Cyan
  966.            4 - Red
  967.            5 - Magenta
  968.            6 - Brown
  969.            7 - White
  970.            8 - Dark grey
  971.            9 - Light blue
  972.           10 - Light green
  973.           11 - Light cyan
  974.           12 - Light red
  975.           13 - Light magenta
  976.           14 - Yellow
  977.           15 - Bright white
  978.  
  979.      The background colors are as follows:
  980.  
  981.            0 - Black
  982.            1 - Blue
  983.            2 - Green
  984.            3 - Cyan
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.      TriDoor                                                             11
  998.  
  999.            4 - Red
  1000.            5 - Magenta
  1001.            6 - Brown
  1002.            7 - White
  1003.            8 - Black with blinking foreground
  1004.            9 - Blue with blinking foreground
  1005.           10 - Green with blinking foreground
  1006.           11 - Cyan with blinking foreground
  1007.           12 - Red with blinking foreground
  1008.           13 - Magenta with blinking foreground
  1009.           14 - Yellow with blinking foreground
  1010.           15 - White with blinking foreground
  1011.  
  1012.      The following constants are defined in TRIDOOR.H to  make it easier to
  1013.      specify color values:
  1014.  
  1015.            0 - BLACK
  1016.            1 - BLUE
  1017.            2 - GREEN
  1018.            3 - CYAN
  1019.            4 - RED
  1020.            5 - MAGENTA
  1021.            6 - BROWN
  1022.            7 - LIGHTGRAY
  1023.            8 - DARKGRAY
  1024.            9 - LIGHTBLUE
  1025.           10 - LIGHTGREEN
  1026.           11 - LIGHTCYAN
  1027.           12 - LIGHTRED
  1028.           13 - LIGHTMAGENTA
  1029.           14 - YELLOW
  1030.           15 - WHITE
  1031.  
  1032.  
  1033.      int TDTimeLeft(void);
  1034.  
  1035.      The TDTimeLeft function returns  the number of minutes the  caller has
  1036.      remaining.
  1037.  
  1038.  
  1039.      int TDTimeOn(void);
  1040.  
  1041.      The  TDTimeOn function returns the  number of minutes  that the caller
  1042.      has been in the door.
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.      TriDoor                                                             12
  1064.  
  1065.                      ADVANCED SERIAL COMMUNICATIONS ROUTINES
  1066.                      ---------------------------------------
  1067.  
  1068.      This  section documents  the advanced  serial  communications routines
  1069.      that TriDoor has to offer.   You should note that the use of  these is
  1070.      strictly optional.  By default,  the TDInitialize routine performs all
  1071.      of the  set up of the serial port and TriDoor will automatically close
  1072.      the  serial port  when  TriDoor exists  from  memory.   However,  door
  1073.      authors will probably find many uses for these routines for such doors
  1074.      as callback verifiers,  etc.  Basically, if you  don't have a specific
  1075.      reason for using these functions, stay away from them.   They are very
  1076.      low-level and 99% of all doors can be written just fine without them.
  1077.  
  1078.  
  1079.      void TDCommClose(void);
  1080.  
  1081.      The TDCommClose function closes a previously opened serial port.
  1082.  
  1083.  
  1084.      int TDCommGetch(void);
  1085.  
  1086.      The  TDCommGetch function returns  a character from  the serial port's
  1087.      buffer.
  1088.  
  1089.  
  1090.      int TDCommIsCarrier(void);
  1091.  
  1092.      The  TDCommIsCarrier  function returns  TRUE  if  carrier is  present.
  1093.      Otherwise,  TDCommIsCarrier returns  FALSE  to  indicate that  carrier
  1094.      isn't present.
  1095.  
  1096.  
  1097.      int TDCommKeyPressed(void);
  1098.  
  1099.      The  TDCommKeyPressed function returns TRUE  if a key  is available in
  1100.      the serial  port's input buffer.   Otherwise, TDCommKeyPressed returns
  1101.      FALSE to indicate that carrier isn't present.
  1102.  
  1103.  
  1104.      void TDCommModemString(char *string);
  1105.  
  1106.      The TDCommModemString is used to send characters to the modem.  It has
  1107.      a slight delay between  characters, recognizes the <~> character  as a
  1108.      half-second delay, and recognizes any character preceded by a <^> as a
  1109.      control character (i.e., ^M would be a carriage return).
  1110.  
  1111.  
  1112.      void TDCommOpen(int port);
  1113.  
  1114.      The TDCommOpen function  is used  to open a  specified serial  "port".
  1115.      The serial port must be in the range of 1 to 4.  If a nonstandard  IRQ
  1116.      is to be  used, the  TDNonStandardIRQ must  be set  to an  appropriate
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.      TriDoor                                                             13
  1130.  
  1131.      value.   NOTE:  The  TDCommOpen function  is  automatically opened  by
  1132.      TDInitialize; therefore, the TDCommOpen function should only be closed
  1133.      if  the door has  previously closed  the active  serial port  with the
  1134.      TDCommClose function.
  1135.  
  1136.  
  1137.      void TDCommPutch(int c);
  1138.  
  1139.      The TDCommPutch  function sends  the character  specified  by the  "c"
  1140.      parameter out the serial port.
  1141.  
  1142.  
  1143.      void TDCommPuts(char *string);
  1144.  
  1145.      The TDCommPuts  function sends  the string  specified by  the "string"
  1146.      parameter out the serial port.
  1147.  
  1148.  
  1149.      void TDCommSetBaudRate(long rate);
  1150.  
  1151.      The  TDCommSetBaudRate  function  sets  the  baud  rate  to the  speed
  1152.      specified by the "rate" parameter.
  1153.  
  1154.  
  1155.      void TDCommSetDataFormat(int bits, int parity, int stopbits);
  1156.  
  1157.      The TDCommSetDataFormat function sets  the serial port for the  number
  1158.      of bits  specified by the  "bits" parameter  (should be 7  or 8),  the
  1159.      parity  specified  by the  "parity"  parameter  (should be  NO_PARITY,
  1160.      EVEN_PARITY,  or ODD_PARITY), and the number of stop bits specified by
  1161.      the "stopbits" parameter (should be 0 or 1).
  1162.  
  1163.  
  1164.      void TDCommSetDTR(int flag);
  1165.  
  1166.      The TDCommSetDTR function is used  to set the serial port's DTR  line.
  1167.      The new  setting for the DTR line is specified by the "flag" parameter
  1168.      and can be either TRUE or FALSE.
  1169.  
  1170.  
  1171.      void TDCommSetFIFO(int trigger);
  1172.  
  1173.      The TDCommSetFIFO  function  sets the  interrupt trigger  level for  a
  1174.      16550 UART's FIFO buffers.  The trigger level can be set  for 1, 4, 8,
  1175.      or  14 and  is specified  as the  "trigger" parameter.   If  any other
  1176.      trigger level  is specified, the FIFO  buffers will be disabled.   You
  1177.      should note  that  this function  has  no effect  if the  serial  port
  1178.      doesn't have a 16550 UART.
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.      TriDoor                                                             14
  1196.  
  1197.      void TDCommSetPort(long rate, int bits, int parity, int stopbits);
  1198.  
  1199.      The  TDCommSetPort function  sets the  serial port  for the  baud rate
  1200.      specified by the "rate" parameter, the number of bits specified by the
  1201.      "bits" parameter  (should be  7 or  8),  the parity  specified by  the
  1202.      "parity" parameter (should be  NO_PARITY, EVEN_PARITY, or ODD_PARITY),
  1203.      and  the number  of stop  bits specified  by the  "stopbits" parameter
  1204.      (should be 0 or 1).
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.      TriDoor                                                             15
  1262.  
  1263.                                      SUPPORT
  1264.                                      -------
  1265.  
  1266.      You  may obtain assistance with  a TriDoor related  problem by calling
  1267.      The Lobster Buoy at 207-941-0805.
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.      TriDoor                                                             16
  1328.  
  1329.                                   REGISTRATION
  1330.                                   ------------
  1331.  
  1332.      Registration of  TriDoor is only $25.00.   Please use the  form in the
  1333.      file REGISTER.TXT.  When you register TriDoor, you will receive a disk
  1334.      with  registered  versions  the  TriDoor  libraries  for  all  of  the
  1335.      supported compilers.
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.